﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Management;
using System.Text;

namespace WMI.NET.CIM
{
    /// <summary>
    /// The CIM_CopyFileAction class represents moving or copying files from a computer system to a new location. Location information for copying is specified by using either the CIM_ToDirectorySpecification and CIM_FromDirectorySpecification associations, or the CIM_ToDirectoryAction and CIM_FromDirectoryAction associations. The first set is used when the source or target are to exist before any actions are taken. The second set is used when the source or target are created as a part of a previous action. In the latter case, the action to create the directory must occur prior to the CIM_CopyFileAction object.
    /// </summary>
    public class CIM_CopyFileAction : CIM_FileAction
    {

        private Nullable<Boolean> _DeleteAfterCopy;
        private string _Destination;
        private string _Source;

        /// <summary>
        /// If TRUE, the source file is deleted after the copy operation.
        /// </summary>
        public Nullable<Boolean> DeleteAfterCopy { get { return _DeleteAfterCopy; } }

        /// <summary>
        /// Fully qualified destination file name.
        /// </summary>
        public string Destination { get { return _Destination; } }

        /// <summary>
        /// Fully qualified source file name.
        /// </summary>
        public string Source { get { return _Source; } }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="mbo"></param>
        public CIM_CopyFileAction(ManagementBaseObject mbo)
            : base(mbo)
        {
            _DeleteAfterCopy = mbo.GetBoolValue("DeleteAfterCopy");
            _Destination = mbo.GetStringValue("Destination");
            _Source = mbo.GetStringValue("Source");
        }


    }
}
